//
//  ViewController.m
//  02-UIImageViewAnimation
//
//  Created by dllo on 16/7/16.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self creatImageView];
}

- (void)creatImageView
{
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:self.view.frame];
    NSMutableArray *imageArr = [NSMutableArray array];
    for (int i = 0; i < 22; i++) {
        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"Zombie%d.tiff", i]];
        [imageArr addObject:image];
    }
    imageView.animationImages = imageArr;
    imageView.animationDuration = 10;
    imageView.animationRepeatCount = 1;
    [imageView startAnimating];
    [self.view addSubview:imageView];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
